package com.zb.entity.dto;

import com.zb.annotation.IntegerPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author WEN
 * @Date 2024/2/17 0017
 **/
@Data
@ApiModel("系统权限菜单对象")
public class AuthorDto {
    @ApiModelProperty(value = "权限菜单ID，新增不必传，修改不必传")
    private Long id;

    @NotNull(message = "父级ID不能为空")
    @ApiModelProperty(value = "父级ID为0，", required = true, example = "0")
    private Long parentId;

    @NotNull(message = "类型不能为空")
    @IntegerPattern(regexp = "^(1|2|3)$", message = "非法的类型参数")
    @ApiModelProperty(value = "类型：1-导航菜单，2-页面，3-按钮", required = true, example = "1")
    private Integer type;

    @NotNull(message = "是否按钮项不能为空")
    @ApiModelProperty(value = "是否按钮：false-不是，true-是", required = true, example = "false")
    private Boolean button;

    @NotBlank(message = "菜单名称不能为空")
    @Length(min = 2, max = 50, message = "菜单名称长度限制 2~50 个字符")
    @ApiModelProperty(value = "菜单名称", required = true)
    private String name;

    @NotBlank(message = "菜单编码不能为空")
    @Length(message = "菜单编码长度限制 60 个字符")
    @ApiModelProperty(value = "菜单编码", required = true)
    private String code;

    @Length(max = 100, message = "导航路径长度限制 100 个字符")
    @ApiModelProperty(value = "导航路径")
    private String path;

    @Length(max = 200, message = "页面组件路径长度限制 200 个字符")
    @ApiModelProperty(value = "页面组件路径")
    private String component;

    @ApiModelProperty(value = "是否隐藏：false-否，true-是", required = true, example = "false")
    private Boolean hidden;

    @NotBlank(message = "标题名称不能为空")
    @Length(min = 2, max = 10, message = "标题名称长度限制 2~10 个字符")
    @ApiModelProperty(value = "标题名称", required = true)
    private String title;

    @Length(max = 200, message = "菜单图标路径长度限制 200 个字符")
    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @Length(max = 100, message = "描述长度限制100个字符以内")
    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "排序，值越小，越靠前", required = true, example = "0")
    private Integer sort;

    @NotNull(message = "菜单权限状态不能为空")
    @ApiModelProperty(value = "菜单权限状态：false-正常，true-禁用", required = true, example = "false")
    private Boolean status;

}
